package com.nuo.jpa;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.EntityManager;


import org.hibernate.Session;
import org.hibernate.Transaction;

import com.nuo.jpa.entity.User3;
import com.nuo.mybatis.entity.User2;

public class UserManage {
	
	public List getAllUser(){
		List list = new ArrayList();
		
		EntityManager manager = ManagerFactory.getEntityManager();
		User3 user = manager.find(User3.class, 0);
		list.add(user);
		
		return list;
	}
	
/*	
	public void saveOrUpdate(User user){
		Session session = HibernateSessionFactory.getSession();
		Transaction ts = session.beginTransaction();
		
		try{
			session.saveOrUpdate(user);
		}catch(Exception e){
			ts.rollback();
		}finally{
			session.close();
		}
	}
	*/
}
